package com.tang.algorithm.array;

/**
 * @author tlm
 * @Description
 */
public class LeetCode1470 {
    public static void main(String[] args) {
        int[] a = {2,5,1,3,4,7};
        int[] b = shuffle(a,3);
        for (int i = 0; i < b.length; i++) {
            System.out.println(b[i]);
        }
    }
    public static int[] shuffle(int[] nums, int n) {
        int[] res = new int[n*2];
        int a=0,b=0;
        for (int i = 0; i < n*2; i++) {
            if(i%2==0){
                res[i]=nums[a];
                a++;
            }else {
                res[i]=nums[n+b];
                b++;
            }
        }
        return res;
    }
}
